home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 4095
- ClientLeft = 960
- ClientTop = 1530
- ClientWidth = 4845
- Height = 4500
- Icon = "Optimize.frx":0000
- Left = 900
- LinkTopic = "Form1"
- ScaleHeight = 4095
- ScaleWidth = 4845
- Top = 1185
- Width = 4965
- Begin VB.CommandButton Command2
- Caption = "Add 500 Items With Optimization"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 60
- TabIndex = 2
- Top = 480
- Width = 4695
- End
- Begin VB.CommandButton Command1
- Caption = "Add 500 Items Without Optimization"
- Height = 375
- Left = 60
- TabIndex = 1
- Top = 60
- Width = 4695
- End
- Begin ComctlLib.ListView ListView1
- Height = 3015
- Left = 60
- TabIndex = 0
- Top = 960
- Width = 4635
- _Version = 65536
- _ExtentX = 8176
- _ExtentY = 5318
- _StockProps = 205
- ForeColor = -2147483640
- BackColor = -2147483643
- Appearance = 1
- Icons = ""
- SmallIcons = ""
- NumItems = 1
- i1 = "Optimize.frx":0442
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Declare Sub InvalidateRect Lib "user32" (ByVal hWnd As Long, ByVal t As Long, ByVal bErase As Long)
- Private Declare Sub ValidateRect Lib "user32" (ByVal hWnd As Long, ByVal t As Long)
- Private Sub Command1_Click()
- Dim I As Long
- ListView1.View = 3
- With ListView1.ListItems
- .Clear
- For I = 1 To 500
- .Add , , "test " & CStr(I)
- DoEvents
- Next I
- End With
- End Sub
- Private Sub Command2_Click()
- Dim I As Long
- ListView1.View = 3
- With ListView1.ListItems
- .Clear
- For I = 1 To 500
- .Add , , "test " & CStr(I)
- ValidateRect ListView1.hWnd, 0&
- If (I Mod 10) = 0 Then InvalidateRect ListView1.hWnd, 0&, 0&
- DoEvents
- Next I
- End With
- InvalidateRect ListView1.hWnd, 0&, 0&
- End Sub
-